import { PureComponent } from "react"
import UseStoreHOC from "./index"
class Com1 extends PureComponent {
  render() {
    console.log(this.props, "Test2 com1 props.")
    const { onAdd, age } = this.props
    return (
      <div>
        <div>Com1:{age}</div>
        <div>
          <button
            onClick={() => {
              onAdd(1)
            }}
          >
            +1
          </button>
          <button
            onClick={() => {
              onAdd(2)
            }}
          >
            +2
          </button>
          <button
            onClick={() => {
              onAdd(5)
            }}
          >
            +5
          </button>
        </div>
      </div>
    )
  }
}
export default UseStoreHOC(Com1)
